﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Collections.ObjectModel;

namespace Whoever.Patterns.CodeAssistance
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
		public ObservableCollection<Field> Fields { get; set; }

        public MainWindow()
        {
            InitializeComponent();
			Fields = new ObservableCollection<Field>();
			Fields.Add(new Field() { Name = "Username", Length = 100, Required = true });
			Fields.Add(new Field() { Name = "Password", Length = 80, Required = true });
			Fields.Add(new Field() { Name = "City", Length = 100, Required = false });
			Fields.Add(new Field() { Name = "State", Length = 40, Required = false });
			Fields.Add(new Field() { Name = "Zipcode", Length = 60, Required = false });

			FieldsListBox.ItemsSource = Fields;
        }

        Window businessWindow = new BusinessLayerWindow();

        private void buttonBusinessLayer_Click(object sender, RoutedEventArgs e)
        {
            //frame1.Content = businessWindow;
			
        }
		public class Field
		{
			public string Name { get; set; }
			public int Length { get; set; }
			public bool Required { get; set; }
		}
    }
}
